import { ColumnProps } from "/@/components/ProTable/interface";
import { loginSource } from "/@/utils/serviceDict";

// 配置项
const columns = (): Partial<ColumnProps>[] => {
    return [{
            type: "selection",
            width: 60,
            fixed: "left"
        },
        {
            type: "index",
            label: "#",
            width: 60
        },
        {
            prop: "username",
            label: "用户名称",
            search: true,
            width: 140,
        },
        {
            prop: "loginIp",
            label: "登录IP",
            width: 180,
            search: true,
        },
        {
            prop: "loginTime",
            label: "登录时间",
            width: 180,
        },
        {
            prop: "source",
            label: "登录来源",
            width: 180,
            search: true,
            tag: true,
            enum: loginSource,
            searchType: "select"
        },
        {
            prop: "browserInfo",
            label: "浏览器信息",
        },
        {
            prop: "grantType",
            label: "登录方式",
            width:180,
        },
        {
            prop: "operation",
            label: "操作",
            width: 120,
            fixed: "right"
        }
    ]
}

export default columns;